package cuit.campus.taskRunning.user.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;

public enum TaskStatusEnum {
    WAITING(0,"待接单"),
    COMPLETED(1,"已完成"),
    CANCELLED(2,"已取消");
    @EnumValue
    private Integer num;
    @JsonValue
    private String status;
    TaskStatusEnum(Integer num, String status)
    {
        this.num = num;
        this.status = status;
    }
    Integer getNum(){
        return num;
    }
    String getStatus() {
        return status;
    }
    public static TaskStatusEnum getByNum(Integer num) {
        for(TaskStatusEnum status: values())
        {
            if(status.getNum().equals(num))
                return status;
        }
        return null;

    }
}
